<#include "*/component/CombineFieldTags.ftl"/>
<@Title>
<#if entity.table.containsCombineColumn>
import ${context.projectPackage}.common.utils.ColumnUtils;
</#if>
</@Title>
<@ClassAnnotation>
@Data
@SqlTableAlias(aliasFromClass = ${entity.entityName}Entity.class)
</@ClassAnnotation>
<@Class extends="NotDeleteCondition">

<#-- 排序 -->
<@ClassAnnotation>
${'\t'}@Data
${'\t'}@SqlTableAlias(aliasFromClass = ${entity.entityName}Entity.class)
</@ClassAnnotation>
<@Class static=true name="QueryOrder" tabTimes=1>
${'\t'}${'\t'}@ApiModelProperty(value = "更新时间")
${'\t'}${'\t'}@SqlColumn(name = "update_time")
${'\t'}${'\t'}@SqlOrderBy(index = 99)
${'\t'}${'\t'}private OrderBy updateTime = OrderBy.desc;
</@Class>

${'\t'}@ApiModelProperty("排序")
${'\t'}private QueryOrder order = new QueryOrder();
<#-- 直接查询条件 -->

<#list entity.fields as field>
<#if field.condition??>
${'\t'}@SqlColumn(name = "${field.column.name}")
${'\t'}@SqlCondition(conditionOperator = ConditionOperator.<#if field.condition=='like'>INCLUDE<#else>EQUAL</#if>)
      <@Field field=field comment=false useSwagger=true></@Field>
</#if>
</#list>

${'\t'}public static ${entity.entityName}Criteria create(){
${'\t'}${'\t'}return new ${entity.entityName}Criteria();
${'\t'}}
<#list entity.fields as field>
<#if field.column.uniqueKey>

${'\t'}public ${entity.entityName}Criteria ${field.name}(<@CombineParam field=field showTpye=true/>){
${'\t'}${'\t'}this.${field.name} = <@CombineValue field=field/>;
${'\t'}${'\t'}return this;
${'\t'}}
</#if>
</#list>

</@Class>
